REPLACE INTO translators VALUES ('0dda3f89-15de-4479-987f-cc13f1ba7999', '1.0.0b4.r1', '', '2008-12-22 19:50:00', 1, 100, 4, 'Ancestry.com US Federal Census', 'Elena Razlogova', '^https?://search.ancestry.com/(.*)usfedcen|1890orgcen|1910uscenindex',
'function detectWeb(doc, url) {
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
var result = doc.evaluate(''//div[@class="g_container"]/div[@class="g_panelWrap"]/div[@class="g_panelCore"]/div[@class="s_container"]/div[@class="p_rsltList"]'', doc, nsResolver,
XPathResult.ANY_TYPE, null).iterateNext();
var rows = doc.evaluate(''//div[@class="g_container"]/div[@class="g_panelWrap"]/div[@class="g_panelCore"]/div[@class="s_container"]/div[@class="p_rsltList"]/table/tbody/tr[@class="tblrow record"]'',
'// this US Federal Census scraper is a hack - so far there is no proper item type in Zotero for this kind of data (added to trac as a low priority ticket)
// this scraper creates proper citation for the census as a whole (should be cited as book)
// but also adds name, city, and state for a particular individual to the citation to make scanning for names & places easier in the middle pane
// (that''s why the resulting item type is a book section)
// it also adds all searchable text as a snapshot and a scan of the census record as an image
function scrape(doc) {
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
// get initial census data; a proper census record item type should have separate fields for all of these except perhaps dbid
var info = doc.evaluate(''//div[@class="facets"][@id="connect"]/div[@class="g_box"]/p/a'',
// add particular individual being surveyed as contributor - this is not proper citation but is needed so one could easily scan for names in middle pane
var creator = new Array();
creator.firstName = firstName;
creator.lastName = lastName;
creator.creatorType = "author";
newItem.creators.push(creator);
//add proper author for citation
var creator = new Array();
creator.lastName = "United States of America, Bureau of the Census";
creator.creatorType = "contributor";
newItem.creators.push(creator);
// get scan of the census image
var scanInfo = doc.evaluate(''//div[@id="record-main"]/table[@class="p_recTable"]/tbody/tr/td[2][@class="recordTN"]/a'',
var items = Zotero.Utilities.getItemArray(doc, doc, ''/WebZ/FSFETCH\\?fetchtype=fullrecord'', ''^(See more details for locating this item|Detailed Record)$'');
REPLACE INTO translators VALUES ('54ac4ec1-9d07-45d3-9d96-48bed3411fb6', '1.0.0b4.r5', '', '2009-02-08 22:10:00', 1, 100, 4, 'National Library of Australia (new catalog)', 'Mark Triggs and Steve McPhillips', 'catalogue.nla.gov.au',
'function detectWeb(doc, url) {
if (url.match("/Record/[0-9]+")) {
var format = Zotero.Utilities.cleanString(doc.getElementById("myformat").textContent);
if (format == "Audio") {
return "audioRecording";
}
else if (format == "Book") {
return "book";
}
else if (format == "Journal/Newspaper") {
return "journalArticle";
}
else if (format == "Manuscript") {
return "manuscript";
}
else if (format == "Map") {
return "map";
}
else if (format == "Music") {
return "audioRecording";
}
else if (format == "Online") {
return "webpage";
}
else if (format == "Picture") {
return "artwork";
}
else if (format == "Video") {
return "videoRecording";
}
else {
return "book";
}
} else if (url.match ("/Search/Home") &&
doc.getElementById ("resultItemLine1")) {
return "multiple";
}
}',
'function as_array(obj) {
if (obj instanceof Array) {
return obj;
} else {
return [obj];
}
}
function load_item(responseText, requestObject, format) {
var metadata = JSON.parse(Zotero.Utilities.cleanString(responseText));
//Some entries do not work for some reason unbeknownst to me; this flag catches the problem and prevents an error, but doesn''t save the data properly.
REPLACE INTO translators VALUES ('587aa172-af1a-4cab-b188-2b6d392cae5c', '1.0', '', '2008-09-22 20:20:00', '0', '100', '4', 'Unidade de Biologia da Conservaçao', 'Giovanni Manghi and Michael Berkowitz', 'http://www.ubc.uevora.pt/',
'function detectWeb(doc, url) {
if(doc.title == "UBC: referencia bibliografica") {
return "book";
} else if (doc.evaluate(''//tr[@class]/td/a'', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
return "multiple";
}
}',
'function doWeb(doc, url) {
if (detectWeb(doc, url) == "multiple") {
var xpath = ''//tr[@class]/td/a'';
var items = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null);
newItem.notes.push({title:"Title", note:"To view this entry in your browser, please go to''http://aabc.bc.ca/WWW.aabc.archbc/access'' and search for the entry Title "});
newItem.complete();
}
function doWeb(doc, url) {
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
var articles = new Array();
if (detectWeb(doc, url) == "multiple") {
var items = new Object();
var xPathTitles = doc.evaluate(''//tr[1]/td[2][@class="datatext"]'', doc, nsResolver, XPathResult.ANY_TYPE, null);
var nextTitle;
var xPathLinks = doc.evaluate(''//td[1][@class="dataleft"]/a'', doc, nsResolver, XPathResult.ANY_TYPE, null);
var title = Zotero.Utilities.cleanString(doc.evaluate(''//table/tbody/tr/td[b="Title"]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext().lastChild.textContent);
var series = Zotero.Utilities.cleanString(doc.evaluate(''//table/tbody/tr/td[b="Series number"]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext().lastChild.textContent);
var control = Zotero.Utilities.cleanString(doc.evaluate(''//table/tbody/tr/td[b="Control symbol"]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext().lastChild.textContent);
var date = Zotero.Utilities.cleanString(doc.evaluate(''//table/tbody/tr/td[b="Contents date range"]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext().lastChild.textContent);
var access = Zotero.Utilities.cleanString(doc.evaluate(''//table/tbody/tr/td[b="Access status"]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext().lastChild.textContent);
var location = Zotero.Utilities.cleanString(doc.evaluate(''//table/tbody/tr/td[b="Location"]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext().lastChild.textContent);
var barcode = Zotero.Utilities.cleanString(doc.evaluate(''//table/tbody/tr/td[b="Barcode"]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext().lastChild.textContent);
if (doc.body.innerHTML.match("View digital copy")) {
var digitised = "yes";
} else {
var digitised = "no";
}
var repository ="National Archives of Australia, " + location;
var url = "http://www.aa.gov.au/cgi-bin/Search?O=I&Number=" + barcode;
REPLACE INTO translators VALUES ('9499c586-d672-42d6-9ec4-ee9594dcc571', '1.0.0b4.r5', '', '2008-05-08 20:30:00', '0', '100', '4', 'The Hindu', 'Prashant Iyengar and Michael Berkowitz', 'http://(www.)?hindu.com',
'function detectWeb(doc, url) {
if (doc.evaluate(''//h2[@class="r"]/a[@class="l"]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
return "multiple";
} else {
return "newspaperArticle";
}
}
',
'function regexMeta(str, item) {
var re = /NAME\=\"([\w\W]*?)\"\s+CONTENT\=\"([\w\W]*?)\"/;
var stuff = str.match(re);
if (stuff)
{
if (stuff[1] == "PAGEHEAD") {
item.section = stuff[2].split(/\s+/)[0];
}
if (stuff[1] == "ZONE") {
item.place = stuff[2].split(/\s+/)[0];
}
if (stuff[1] == "PAGENUMBER") {
item.pages = stuff[2].split(/\s+/)[0];
}
}
}
function doWeb(doc, url) {
var arts = new Array();
if (detectWeb(doc, url) == "multiple") {
var xpath = ''//h2[@class="r"]/a[@class="l"]'';
var links = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null);
var link;
var items = new Object();
while (link = links.iterateNext()) {
items[link.href] = link.textContent;
}
items = Zotero.selectItems(items);
for (var i in items) {
arts.push(i);
}
} else { arts = [url]; }
for each (var art in arts) {
Zotero.debug(art);
Zotero.Utilities.HTTP.doGet(art, function(text) {
var newItem = new Zotero.Item("newspaperArticle");
if (prefix == ''x'') return namespace; else return false;
} : null;
var items = new Object();
var titles = doc.evaluate(''//p[@class="articletitle"]'', doc, nsResolver, XPathResult.ANY_TYPE, null);
var title;
while (title = titles.iterateNext()) {
var text = Zotero.Utilities.trimInternal(title.textContent);
items[text] = text;
}
items = Zotero.selectItems(items);
Zotero.debug(items);
var articles = doc.evaluate(''//div[@id="maincontent"]/table[*//p[@class="articletitle"]]'', doc, nsResolver, XPathResult.ANY_TYPE, null);
var art;
while (art = articles.iterateNext()) {
var title = Zotero.Utilities.trimInternal(doc.evaluate(''.//p[@class="articletitle"]'', art, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent);
if (items[title]) {
var pdfurl = doc.evaluate(''.//a[contains(text(), "FULL TEXT")]'', art, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().href;
var item = new Zotero.Item("journalArticle");
item.publicationTitle = "European Educational Research Journal";
var data = Zotero.Utilities.trimInternal(doc.evaluate(''//p[span[@class="bibDataTag"]][1]'', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent);
data = data.replace(/(Journal|MSC|Posted|Retrieve)/g, "\n$1");
Zotero.debug(data);
var authors = data.match(/Author\(s\):\s+(.*)\n/)[1].split(/;\s+/);
REPLACE INTO translators VALUES ('5278b20c-7c2c-4599-a785-12198ea648bf', '1.0.0b4.r5', '', '2009-02-08 22:10:00', 1, 100, 4, 'ARTstor', 'Ameer Ahmed and Michael Berkowitz', 'http://[^/]artstor.org[^/]*',
'function detectWeb(doc, url) {
if (url.match(/(S|s)earch/) && (doc.evaluate(''//div[@id="thumbContentWrap"]/div'', doc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent.match(/\w+/))) return "multiple"
}',
'function doWeb(doc, url) {
if (url.indexOf("|")!=-1){
scrape(doc, url);
}
}
function scrape(doc, url){
var savedItems = new Array();
var saved = 0;
var urlstub = url.substring(url.indexOf(''.org/'')+5,url.length);
// Initial query to get results from the service - primary purpose is to get objectids. which in turn are required for the 2nd service call, which exposes the actual metadata
if (doc.evaluate(''//input[@name="id"]'', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext()) {
var id = doc.evaluate(''//input[@name="id"]'', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().value;
var lstSelectedUIDs = doc.evaluate(''//input[@name="lstUIDs"][@id="srhLstUIDs"]'', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().value;
var get = ''http://psycnet.apa.org/index.cfm?fa=search.export&id='' + id + ''&lstSelectedUIDs='' + lstSelectedUIDs + ''&lstUIDs=&records=selected&displayFormat=&exportFormat=referenceSoftware&printDoc=0'';
REPLACE INTO translators VALUES ('f203db7f-7b7b-4dc4-b018-115b7885fe3b', '1.0.0b4.r5', '', '2008-07-10 06:15:00', '0', '100', '4', 'Oxford Music and Art Online', 'Michael Berkowitz', 'http://[^/]*www.oxford(music|art)online.com[^/]*/',
'function detectWeb(doc, url) {
if (url.match(/search_results/)) {
return "multiple";
} else if (url.match(/\/article\//)) {
return "journalArticle";
}
}',
'function doWeb(doc, url) {
var host = doc.location.host;
var site = host.match(/oxford(.*)online/)[1];
var ids = new Array();
if (detectWeb(doc, url) == "multiple") {
var items = new Object();
var links = doc.evaluate(''//ul[@class="search_result_list"]/li/p/a'', doc, null, XPathResult.ANY_TYPE, null);
var link;
while (link = links.iterateNext()) {
items[link.href] = link.textContent;
}
items = Zotero.selectItems(items);
for (var i in items) {
ids.push(i.match(/(music|art)\/([^?]+)/)[2]);
}
} else {
ids = [url.match(/(music|art)\/([^?]+)/)[2]];
}
Zotero.debug(ids);
for each (var id in ids) {
var get = ''http://'' + host + ''/subscriber/article_export_citation/grove/'' + site + ''/'' + id;
REPLACE INTO translators VALUES ('dedcae51-073c-48fb-85ce-2425e97f128d', '1.0.0b4.r5', '', '2008-04-18 08:55:00', '0', '100', '4', 'Archive Ouverte en Sciences de l''Information et de la Communication (AOSIC)', 'Michael Berkowitz', 'http://archivesic.ccsd.cnrs.fr/',
'function detectWeb(doc, url) {
if (doc.title.toLowerCase().match("fulltext search")) {
return "multiple";
} else if (url.match(/sic_\d+/)) {
return "journalArticle";
}
}',
'var metaTags = {
"DC.relation":"url",
"DC.date":"date",
"DC.description":"abstractNote",
"DC.creator":"creators",
"DC.title":"title"
}
function doWeb(doc, url) {
var articles = new Array();
if (detectWeb(doc, url) == "multiple") {
var items = Zotero.Utilities.getItemArray(doc, doc, /sic_\d+\/fr\//);
if (sirsiNew) { //executes Simon''s SIRSI 2003+ scraper code
Zotero.debug("Running SIRSI 2003+ code");
if(!scrape(doc)) {
var checkboxes = new Array();
var urls = new Array();
var availableItems = new Array();
//begin IUCAT fixes by Andrew Smith
var iuRe = /^https?:\/\/www\.iucat\.iu\.edu/;
var iu = iuRe.exec(url);
//IUCAT fix 1 of 2
if (iu){
var tableRows = doc.evaluate(''//td[@class="searchsum"]/table[//input[@class="submitLink"]]'', doc, nsResolver, XPathResult.ANY_TYPE, null);
} else{
var tableRows = doc.evaluate(''//td[@class="searchsum"]/table[//input[@value="Details"]]'', doc, nsResolver, XPathResult.ANY_TYPE, null);
}
var tableRow = tableRows.iterateNext(); // skip first row
// Go through table rows
while(tableRow = tableRows.iterateNext()) {
//IUCAT fix 2 of 2
if (iu){
var input = doc.evaluate(''.//input[@class="submitLink"]'', tableRow, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
var text = doc.evaluate(''.//label/span'', tableRow, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
} else {
var input = doc.evaluate(''.//input[@value="Details"]'', tableRow, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
var text = doc.evaluate(''.//label/strong'', tableRow, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
}
//end IUCAT fixes by Andrew Smith
if(text) {
availableItems[input.name] = text;
}
}
var items = Zotero.selectItems(availableItems);
if(!items) {
return true;
}
var hostRe = new RegExp("^http(?:s)?://[^/]+");
var m = hostRe.exec(doc.location.href);
Zotero.debug("href: " + doc.location.href);
var hitlist = doc.forms.namedItem("hitlist");
var baseUrl = m[0]+hitlist.getAttribute("action")+"?first_hit="+hitlist.elements.namedItem("first_hit").value+"&last_hit="+hitlist.elements.namedItem("last_hit").value;
var documents = text.split("*** DOCUMENT BOUNDARY ***");
for(var j=1; j<documents.length; j++) {
var uri = newUri+"?marks="+recNumbers[j]+"&shadow=NO&format=FLAT+ASCII&sort=TITLE&vopt_elst=ALL&library=ALL&display_rule=ASCENDING&duedate_code=l&holdcount_code=t&DOWNLOAD_x=22&DOWNLOAD_y=12&address=&form_type=";
REPLACE INTO translators VALUES ('d921155f-0186-1684-615c-ca57682ced9b', '1.0.0b4.r1', '', '2009-01-28 18:10:00', 1, 100, 4, 'JSTOR', 'Simon Kornblith, Sean Takats, Michael Berkowitz and Eli Osherovich', 'https?://[^/]*jstor\.org[^/]*/(action/(showArticle|doBasicSearch|doAdvancedSearch|doLocatorSearch)|stable/|pss/)',
'function detectWeb(doc, url) {
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
// See if this is a seach results page or Issue content
if (doc.title == "JSTOR: Search Results" || url.match(/\/i\d+/)) {
return "multiple";
} else if(url.indexOf("/search/") != -1) {
return false;
}
// If this is a view page, find the link to the citation
var xpath = ''//a[@id="favorites"]'';
var elmt = doc.evaluate(xpath, doc, nsResolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
if(elmt || url.match(/pss/)) {
return "journalArticle";
}
}',
'function doWeb(doc, url) {
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
var host = doc.location.host;
// If this is a view page, find the link to the citation
var xpath = ''//a[@id="favorites"]'';
var elmt = doc.evaluate(xpath, doc, nsResolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
var allJids = new Array();
if (elmt && /jid=(\d+)/.test(elmt.href)) {
allJids.push(RegExp.$1);
Zotero.debug("JID found 1 " + jid);
}
else if (/(?:pss|stable)\/(\d+)/.test(url)) {
Zotero.debug("URL " + url);
allJids.push(RegExp.$1);
Zotero.debug("JID found 2 " + jid);
}
else {
// We have multiple results
var resultsBlock = doc.evaluate(''//fieldset[@id="results"]'', doc, nsResolver, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
if (! resultsBlock) {
return true;
}
var allTitlesElmts = doc.evaluate(''//li/ul/li/a[@class="title"]'', resultsBlock, nsResolver, XPathResult.ANY_TYPE, null);
var currTitleElmt;
var availableItems = new Object();
while (currTitleElmt = allTitlesElmts.iterateNext()) {
var title = currTitleElmt.textContent;
var jid = currTitleElmt.href.match(/stable\/(\d+)/)[1];
if (jid) {
availableItems[jid] = title;
}
Zotero.debug("Found title " + title+jid);
}
Zotero.debug("End of titles");
var selectedItems = Zotero.selectItems(availableItems);
if (newDoc.evaluate(''//div[@class="abstractSection"]/p[contains(@class, "last") or contains(@class, "first")]'', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
var abs = Zotero.Utilities.trimInternal(newDoc.evaluate(''//div[@class="abstractSection"]/p[contains(@class, "last") or contains(@class, "first")]'', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent);
}
var doi = getDOI(newDoc.location.href);
var risurl = ''http://www.mitpressjournals.org/action/downloadCitation?doi='' + doi + ''&include=cit&format=refman&direct=on&submit=Download+article+metadata'';
var pdfurl = newDoc.location.href.replace("/doi/abs/", "/doi/pdf/");
var rows = newDoc.evaluate(''//div[@class="fichaISBN"]/table/tbody/tr'', newDoc, null, XPathResult.ANY_TYPE, null);
var next_row;
while (next_row = rows.iterateNext()) {
var heading = newDoc.evaluate(''./th'', next_row, null, XPathResult.ANY_TYPE, null).iterateNext().textContent;
var value = newDoc.evaluate(''./td'', next_row, null, XPathResult.ANY_TYPE, null).iterateNext().textContent;
data[heading.replace(/\W/g, "")] = value;
}
var isbn = Zotero.Utilities.trimInternal(newDoc.evaluate(''//span[@class="cabTitulo"]/strong'', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent);
if (prefix == ''x'') return namespace; else return null;
} : null;
var articles = new Array();
if (detectWeb(doc, url) == "multiple") {
items = new Object();
var boxes = doc.evaluate(''//table/tbody/tr[@class]/td[@class="fldtextPad"][1]'', doc, nsResolver, XPathResult.ANY_TYPE, null);
var box;
while (box = boxes.iterateNext()) {
var title = Zotero.Utilities.trimInternal(doc.evaluate(''.//span[@class="txtBoldOnly"]'', box, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent);
var link = doc.evaluate(''.//a[@class="outwardLink"]'', box, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().href;
REPLACE INTO translators VALUES ('0a84a653-79ea-4c6a-8a68-da933e3b504a', '1.0.0b4.r5', '', '2008-03-28 16:30:00', '0', '100', '4', 'Alexander Street Press', 'John West and Michael Berkowitz', 'http://(?:www\.)alexanderstreet',
'function detectWeb(doc, url) {
if( url.indexOf("object.details.aspx") != -1 ) {
var zitemtype = doc.getElementById("ctl00_ctl00_MasterContentBody_ContentPlaceHolder1_txtZType").value;
switch (zitemtype.toLowerCase()) {
case "book":
return "book";
break;
case "chapter":
return "bookSection";
break;
case "journal":
return "journalArticle";
break;
case "manuscript":
return "manuscript";
break;
case "audio":
return "audioRecording";
break;
case "video":
return "videoRecording";
break;
case "issue":
return "journalArticle";
break;
case "article":
return "journalArticle";
break;
case "series":
return "interview";
break;
case "session":
return "interview";
break;
default:
return "document";
}
} else if (url.indexOf("results.aspx") != -1) {
return "multiple";
}
}',
'function scrape(doc, url) {
// set prefix for serverside control
var p = "ctl00_ctl00_MasterContentBody_ContentPlaceHolder1_txtZ";
// get values from hidden inputs
var ztype = GetItemType(doc.getElementById(p+"Type").value);
var ztitle = doc.getElementById(p+"Title").value;
var zbooktitle = doc.getElementById(p+"BookTitle").value;
var znotes = doc.getElementById(p+"Notes").value;
var zurl = doc.getElementById(p+"URL").value;
var zrights = doc.getElementById(p+"Rights").value;
var zseries = doc.getElementById(p+"Series").value;
var zvolume = doc.getElementById(p+"Volume").value;
var zissue = doc.getElementById(p+"Issue").value;
var zedition = doc.getElementById(p+"Edition").value;
var zplace = doc.getElementById(p+"Place").value;
var zpublisher = doc.getElementById(p+"Publisher").value;
var zpages = doc.getElementById(p+"Pages").value;
var zrepository = doc.getElementById(p+"Repository").value;
var zlabel = doc.getElementById(p+"Label").value;
var zrunningTime = doc.getElementById(p+"RunningTime").value;
var zlanguage = doc.getElementById(p+"Language").value;
var zauthor = doc.getElementById(p+"Author").value;
var zeditor = doc.getElementById(p+"Editor").value;
var ztranslator = doc.getElementById(p+"Translator").value;
var zinterviewee = doc.getElementById(p+"Interviewee").value;
var zinterviewer = doc.getElementById(p+"Interviewer").value;
var zrecipient = doc.getElementById(p+"Recipient").value;
var zdirector = doc.getElementById(p+"Director").value;
var zscriptwriter = doc.getElementById(p+"ScriptWriter").value;
var zproducer = doc.getElementById(p+"Producer").value;
var zcastMember = doc.getElementById(p+"CastMember").value;
var zperformer = doc.getElementById(p+"Performer").value;
var zcomposer = doc.getElementById(p+"Composer").value;
newArticle.attachments = [{url:doc.location.href, title:"Alexander Street Press Snapshot", mimeType:"text/html"}];
if (doc.evaluate(''//a[contains(@href, "get.pdf")]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
var pdfurl = doc.evaluate(''//a[contains(@href, "get.pdf")]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext().href;
newArticle.attachments.push({url:pdfurl, title:"Alexander Street Press PDF", mimeType:"application/pdf"});
} else if (doc.evaluate(''//a[contains(@href, "get.jpg")]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
var imgurl = doc.evaluate(''//a[contains(@href, "get.jpg")]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext().href.replace(/.{2}$/, "01");
newArticle.attachments.push({url:imgurl, title:"Alexander Street Press Pg 1", mimeType:"image/jpg"});
newArticle.notes = [{note:"Further page images can be found by following the URL of the ''Alexander Street Press Pg 1'' attachment and iterating the final digits of the URL"}];
}
// save Zotero item
newArticle.complete();
}
function GetItemType(zitemtype) {
switch (zitemtype.toLowerCase()) {
case "book":
return "book";
break;
case "chapter":
return "bookSection";
break;
case "journal":
return "journalArticle";
break;
case "manuscript":
return "manuscript";
break;
case "audio":
return "audioRecording";
break;
case "video":
return "videoRecording";
break;
case "issue":
return "journalArticle";
break;
case "article":
return "journalArticle";
break;
case "series":
return "interview";
break;
case "session":
return "interview";
break;
default:
return "document";
}
}
function doWeb(doc, url) {
var articles = new Array();
if (detectWeb(doc, url) == "multiple") {
var items = new Object();
var xpath = ''//tbody/tr/td[2][@class="data"]/a[1]'';
var titles = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null);
if (newDoc.evaluate(''//td[@class="standard"]/a'', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) var pdf = newDoc.evaluate(''//td[@class="standard"]/a'', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext().href;
REPLACE INTO translators VALUES ('d3b1d34c-f8a1-43bb-9dd6-27aa6403b217', '1.0.0rc4', '', '2009-02-25 07:15:00', 1, 100, 4, 'YouTube', 'Sean Takats and Michael Berkowitz and Matt Burton', 'https?://[^/]*youtube\.com\/',
'function detectWeb(doc, url){
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
var xpath = ''//input[@type="hidden" and @name="video_id"]'';
{url:''http://www.pdb.org/pdb/download/downloadFile.do?fileFormat=pdb&compression=NO&structureId='' + proteins[p], title:"Protein Data Bank .pdb File", mimeType:"chemical/x-pdb"}
if (newDoc.evaluate(''//p[@class="upload_p_left"][contains(text(), "Download not available")]'', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
var DOI = newDoc.evaluate(''//td[2]/span[@class="toc_VolumeLine"]'', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext().textContent.match(/doi:\s*(.*)$/)[1];
var PDF = newDoc.evaluate(''//div[@class="jovHistory"]//td[2]/a'', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext().href;
{url:"http://ascelibrary.aip.org/getpdf/servlet/GetPDFServlet?filetype=pdf&id=" + key + "&idtype=cvips&prog=search", title:"EAS Full Text PDF", mimeType:"application/pdf"}
];
//item.itemType = "journalArticle";
item.complete();
});
translator.translate();
Zotero.wait();
Zotero.done();
});
}
function doWeb(doc, url) {
var articles = new Array();
var items = new Object();
var xpath = ''//div[@class="sr-right"]/p[@class="sr-art-title"]/a'';
if (doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
var titles = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null);
while (new_title = titles.iterateNext()) {
items[new_title.href] = new_title.textContent;
}
items = Zotero.selectItems(items);
for (var i in items) {
articles.push(i)
}
} else {
var newx = ''//div[@id="sci-art-options-box"]//input[@name="SelectCheck"]'';
var stuff = doc.evaluate(newx, doc, null, XPathResult.ANY_TYPE, null).iterateNext().value;
if (newDoc.evaluate(''//div[@class="doc-head"]/p[contains(text(), "DOI")][@class="info"]'', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext()) {
var doi = newDoc.evaluate(''//div[@class="doc-head"]/p[contains(text(), "DOI")][@class="info"]'', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
doi = Zotero.Utilities.trimInternal(doi.substr(4));
}
var issn = newDoc.evaluate(''//div[@id="pageTitle"]/p/a'', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().href.match(/issn=([^&]+)/)[1];
var getURL = "http://spiedigitallibrary.aip.org/getabs/servlet/GetCitation?fn=view_isi&source=scitation&PrefType=ARTICLE&PrefAction=Add+Selected&SelectCheck=";
var selectid=doc.evaluate(singXpath, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().value;
Zotero.debug("Node Value: "+selectid);
//single
var url="http://spiedigitallibrary.aip.org/getabs/servlet/GetCitation?fn=view_isi&source=scitation&PrefType=ARTICLE&PrefAction=Add+Selected&SelectCheck=";
REPLACE INTO translators VALUES ('a1a97ad4-493a-45f2-bd46-016069de4162', '1.0.0b4.r1', '', '2009-01-06 21:05:00', 1, 100, 4, 'Optical Society of America', 'Michael Berkowitz and Eli Osherovich', 'https?://[^.]+\.(opticsinfobase|osa)\.org',
'function detectWeb(doc, url) {
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
var searchpath = ''//div[@id="col2"]/p/strong/a'';
if (doc.evaluate(searchpath, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext()) {
return "multiple";
} else if (url.indexOf("abstract.cfm") != -1) {
return "journalArticle";
}
}',
'function doWeb(doc, url) {
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
var host = doc.location.host;
var articles = new Array();
if (detectWeb(doc, url) == "multiple") {
var items = new Object();
var xpath = ''//div[@id="col2"]/p/strong/a'';
var arts = doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null);
if (doc.evaluate(''//span[@id="knownuser"]'', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext()) {
var id = doc.location.href.match(/abstract_id=(\d+)/)[1];
if (doc.evaluate(''//a[@title="Download from Social Science Research Network"]'', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext()) {
var pdfurl = doc.evaluate(''//a[@title="Download from Social Science Research Network"]'', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().href;
}
var newURL = ''http://papers.ssrn.com/sol3/RefExport.cfm?abstract_id='' + id + ''&format=3'';
var tableRows = doc.evaluate(''//table[@class="browseScreen"]//tr[@class="browseEntry" or @class="briefCitRow" or td/input[@type="checkbox"] or td[contains(@class,"briefCitRow")]]'',
doc, nsResolver, XPathResult.ANY_TYPE, null);
// Go through table rows
var i = 0;
while(tableRow = tableRows.iterateNext()) {
// get link
var links = doc.evaluate(''.//span[@class="briefcitTitle"]/a'', tableRow, nsResolver, XPathResult.ANY_TYPE, null);
var link = links.iterateNext();
if(!link) {
var links = doc.evaluate(".//a", tableRow, nsResolver, XPathResult.ANY_TYPE, null);
link = links.iterateNext();
}
if(link) {
if(availableItems[link.href]) {
continue;
}
// Go through links
while(link) {
if (link.textContent.match(/\w+/)) availableItems[link.href] = link.textContent;
if (sirsiNew) { //executes Simon''s SIRSI 2003+ scraper code
Zotero.debug("Running SIRSI 2003+ code");
if(!scrape(doc)) {
var checkboxes = new Array();
var urls = new Array();
var availableItems = new Array();
//begin IUCAT fixes by Andrew Smith
var iuRe = /^https?:\/\/www\.iucat\.iu\.edu/;
var iu = iuRe.exec(url);
//IUCAT fix 1 of 2
if (iu){
var tableRows = doc.evaluate(''//td[@class="searchsum"]/table[//input[@class="submitLink"]]'', doc, nsResolver, XPathResult.ANY_TYPE, null);
} else{
var tableRows = doc.evaluate(''//td[@class="searchsum"]/table[//input[@value="Details"]]'', doc, nsResolver, XPathResult.ANY_TYPE, null);
}
var tableRow = tableRows.iterateNext(); // skip first row
// Go through table rows
while(tableRow = tableRows.iterateNext()) {
//IUCAT fix 2 of 2
if (iu){
var input = doc.evaluate(''.//input[@class="submitLink"]'', tableRow, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
var text = doc.evaluate(''.//label/span'', tableRow, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
} else {
var input = doc.evaluate(''.//input[@value="Details"]'', tableRow, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
var text = doc.evaluate(''.//label/strong'', tableRow, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
}
//end IUCAT fixes by Andrew Smith
if(text) {
availableItems[input.name] = text;
}
}
var items = Zotero.selectItems(availableItems);
if(!items) {
return true;
}
var hostRe = new RegExp("^http(?:s)?://[^/]+");
var m = hostRe.exec(doc.location.href);
Zotero.debug("href: " + doc.location.href);
var hitlist = doc.forms.namedItem("hitlist");
var baseUrl = m[0]+hitlist.getAttribute("action")+"?first_hit="+hitlist.elements.namedItem("first_hit").value+"&last_hit="+hitlist.elements.namedItem("last_hit").value;
var documents = text.split("*** DOCUMENT BOUNDARY ***");
for(var j=1; j<documents.length; j++) {
var uri = newUri+"?marks="+recNumbers[j]+"&shadow=NO&format=FLAT+ASCII&sort=TITLE&vopt_elst=ALL&library=ALL&display_rule=ASCENDING&duedate_code=l&holdcount_code=t&DOWNLOAD_x=22&DOWNLOAD_y=12&address=&form_type=";
var postData = "inPS=true&ts="+time+"&prodId="+postVal.prodId+"&actionCmd=UPDATE_MARK_LIST&userGroupName="+postVal.userGroupName+"&markedString="+markedString+"&a="+time;
var namespace = newDoc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
var xpath = ''//tr[td[1][@class="contentSmall"][@id="bold"]/strong]'';
var elmts = newDoc.evaluate(xpath, newDoc, nsResolver, XPathResult.ANY_TYPE, null);
var elmt;
var record = new marc.record();
while(elmt = elmts.iterateNext()) {
var field = Zotero.Utilities.trimInternal(newDoc.evaluate(''./TD[1]/strong/text()[1]'', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().nodeValue);
var value = newDoc.evaluate(''./TD[2]'', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;
if(field == "LDR") {
record.leader = value;
} else if(field != "FMT") {
value = value.replace(/\|([a-z]) /g, marc.subfieldDelimiter+"$1");
var elmts = newDoc.evaluate(xpath, newDoc, nsResolver, XPathResult.ANY_TYPE, null);
var elmt;
var record = new marc.record();
while(elmt = elmts.iterateNext()) {
if (nonstandard) {
var field = Zotero.Utilities.superCleanString(newDoc.evaluate(''./td[1]'', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent);
} else {
var field = Zotero.Utilities.superCleanString(newDoc.evaluate(''./TD[1]/text()[1]'', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().nodeValue);
}
var field = Zotero.Utilities.superCleanString(newDoc.evaluate(''./td[1]'', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent);
if(field) {
var value = newDoc.evaluate(''./TD[2]'', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent; //.split(/\n/)[1];
if (value.split(/\n/)[1]) value = Zotero.Utilities.trimInternal(value.split(/\n/)[1]);
Zotero.debug(field + " : " + value);
if(field == "LDR") {
record.leader = value;
} else if(field != "FMT") {
value = value.replace(/\|([a-z]) /g, marc.subfieldDelimiter+"$1");
var namespace = newDoc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
var xpath = ''//form/table[@class="tableBackground"]/tbody/tr/td/table[@class="tableBackground"]/tbody/tr[td[1]/a[@class="normalBlackFont1"]]'';
var elmts = newDoc.evaluate(xpath, newDoc, nsResolver, XPathResult.ANY_TYPE, null);
if (!elmts.iterateNext()) {
var xpath2 = ''//form/table[@class="tableBackground"]/tbody/tr/td/table[@class="tableBackground"]/tbody/tr[td[1]/a[@class="boldBlackFont1"]]'';
var elmts = newDoc.evaluate(xpath2, newDoc, nsResolver, XPathResult.ANY_TYPE, null);
}
var elmt;
var record = new marc.record();
while(elmt = elmts.iterateNext()) {
var field = Zotero.Utilities.superCleanString(newDoc.evaluate(''./TD[1]/A[1]/text()[1]'', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().nodeValue);
var value = newDoc.evaluate(''./TD[2]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/A[1]'', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
// value = null for non-marc table entries w/ that xpath
if (!value) {
value = '''';
} else {
value = value.textContent;
}
if(field == "LDR") {
record.leader = value;
} else if(field != "FMT") {
value = value.replace(/\$([a-z]) /g, marc.subfieldDelimiter+"$1");
var namespace = newDoc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
var elmts = newDoc.evaluate(''//table/tbody/tr[@valign="top"]'',
newDoc, nsResolver, XPathResult.ANY_TYPE, null);
var record = new marc.record();
while(elmt = elmts.iterateNext()) {
var field = Zotero.Utilities.superCleanString(newDoc.evaluate(''./TD[1]/text()[1]'', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().nodeValue);
var value = newDoc.evaluate(''./TD[2]/text()[1]'', elmt, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().nodeValue;
// remove spacing
value = value.replace(/^\s+/, "");
value = value.replace(/\s+$/, "");
if(field == 0) {
record.leader = "00000"+value;
} else {
var ind = value[3]+value[5];
if (value.match(/^\d{1,2}\s{3}/)) value = Zotero.Utilities.cleanString(value.replace(/^\d{1,2}\s{3}/, ""));
value = value.replace(/\$([a-z0-9]) /g, marc.subfieldDelimiter+"$1");
if(value[0] != marc.subfieldDelimiter) {
value = marc.subfieldDelimiter+"a"+value;
}
record.addField(field, ind, value);
}
}
var newItem = new Zotero.Item();
record.translate(newItem);
var oldTags = newItem.tags;
var newTags = new Array();
for each (var tag in oldTags) {
if (newTags.indexOf(tag) == -1) newTags.push(tag)
}
newItem.tags = newTags;
newItem.repository = "Berkeley Library Catalog";
newItem.complete();
}, function() { Zotero.done(); }, null);
Zotero.wait();
}');
REPLACE INTO translators VALUES ('d0b1914a-11f1-4dd7-8557-b32fe8a3dd47', '1.0.0b3.r1', '', '2009-01-05 21:20:00', 1, 100, 4, 'EBSCOhost', 'Simon Kornblith and Michael Berkowitz', 'https?://[^/]+/(?:bsi|ehost)/(?:results|detail|folder)',
'function detectWeb(doc, url) {
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
// See if this is a search results or folder results page
var searchResult = doc.evaluate(''//ul[@class="result-list" or @class="folder-list"]/li/div[@class="result-list-record" or @class="folder-item"]'', doc, nsResolver,
XPathResult.ANY_TYPE, null).iterateNext();
if(searchResult) {
return "multiple";
}
/*
var xpath = ''//div[@class="citation-wrapping-div"]/dl[@class="citation-fields"]/dt[starts-with(text(), "Persistent link to this record")''
+'' or starts-with(text(), "Vínculo persistente a este informe")''
+'' or starts-with(text(), "Lien permanent à cette donnée")''
+'' or starts-with(text(), "Permanenter Link zu diesem Datensatz")''
+'' or starts-with(text(), "Link permanente al record")''
+'' or starts-with(text(), "Link permanente para este registro")''
+'' or starts-with(text(), "本記錄固定連結")''
+'' or starts-with(text(), "此记录的永久链接")''
+'' or starts-with(text(), "このレコードへのパーシスタント リンク")''
+'' or starts-with(text(), "레코드 링크 URL")''
+'' or starts-with(text(), "Постоянная ссылка на эту запись")''
+'' or starts-with(text(), "Bu kayda s├╝rekli ba─ƒlant─▒")''
+'' or starts-with(text(), "Μόνιμος σύνδεσμος σε αυτό το αρχείο")]'';
*/
var xpath = ''//input[@id="ctl00_ctl00_MainContentArea_MainContentArea_topDeliveryControl_deliveryButtonControl_lnkExportImage"]'';
var persistentLink = doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
* given the text of the delivery page, downloads an item
*/
function downloadFunction(text) {
var postLocation = /<form (?:autocomplete="o(?:ff|n)" )?name="aspnetForm" method="post" action="([^"]+)"/
var m = postLocation.exec(text);
var deliveryURL = m[1].replace(/&/g, "&");
m = customViewStateMatch.exec(text);
var downloadString = "__EVENTTARGET=&__EVENTARGUMENT=&__CUSTOMVIEWSTATE="+fullEscape(m[1])+"&__VIEWSTATE=&ctl00%24ctl00%24MainContentArea%24MainContentArea%24ctl00%24btnSubmit=Save&ctl00%24ctl00%24MainContentArea%24MainContentArea%24ctl00%24BibFormat=1&ajax=enabled";
if (prefix == ''x'') return namespace; else return null;
} : null;
var hostRe = new RegExp("^(https?://[^/]+)/");
var m = hostRe.exec(url);
host = m[1];
var searchResult = doc.evaluate(''//ul[@class="result-list" or @class="folder-list"]/li/div[@class="result-list-record" or @class="folder-item"]'', doc, nsResolver,
XPathResult.ANY_TYPE, null).iterateNext();
if(searchResult) {
var titlex = ''//div[@class="result-list-record" or @class="folder-item-detail"]/span/a'';
var titles = doc.evaluate(titlex, doc, nsResolver, XPathResult.ANY_TYPE, null);
REPLACE INTO translators VALUES ('4c164cc8-be7b-4d02-bfbf-37a5622dfd56', '1.0.0b3.r1', '', '2006-12-14 00:40:00', 1, 100, 4, 'The New York Review of Books', 'Simon Kornblith', '^https?://www\.nybooks\.com/',
'function detectWeb(doc, url) {
var articleRegexp = /^http:\/\/www\.nybooks\.com\/articles\/[0-9]+\/?/
var doi = newDoc.evaluate(''//div[@class="articleHeaderInner"][@id="articleHeader"]/a[contains(text(), "doi")]'', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent.substr(4);
var tempPDF = newDoc.evaluate(''//a[@class="noul" and div/div[contains(text(), "PDF")]]'', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
if (!tempPDF) { // PDF xpath failed, lets try another
tempPDF = newDoc.evaluate(''//a[@class="noul" and contains(text(), "PDF")]'', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
if (!tempPDF) { // second PDF xpath failed set PDF to null to avoid item.attachments
var PDF = null;
} else {
var PDF = tempPDF.href; // second xpath succeeded, use that link
}
} else {
var PDF = tempPDF.href; // first xpath succeeded, use that link
}
var url = newDoc.location.href;
var get = newDoc.evaluate(''//a[img[contains(@src, "exportarticle_a.gif")]]'', newDoc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().href;
// if the PDF is available make it an attachment otherwise only use snapshot.
var doi = text.match(/ER\s{2}\-\s.*org\/(.*)\n/)[1];
if (doi) item.DOI = doi;
item.complete();
});
translator.translate();
Zotero.done();
});
Zotero.wait();
}');
REPLACE INTO translators VALUES ('b56d756e-814e-4b46-bc58-d61dccc9f32f', '1.0.10', '', '2009-01-11 02:17:07', 1, 100, 4, 'Nagoya University OPAC', 'Frank Bennett', '^http://opac.nul.nagoya-u.ac.jp/',
'function detectWeb(doc, url) {
if (url.match(/.*[^A-Za-z0-9]ID=[A-Z0-9].*$/)) {
var journal_test = doc.evaluate( ''//td[contains(text(),"frequency of publication") or contains(text(),"巻次・年月次")]'', doc, null, XPathResult.ANY_TYPE, null).iterateNext();
if (!journal_test) {
return "book";
}
}
}',
'/*
* Set the texts used to find raw citation elements
*/
function setSpec() {
var spec = new Array();
spec[''title''] = [''題および'',''title and statement''];
* Extract raw string sets from the page. This is the only function that uses
* xpath. The string sets retrieved for each label registered by setSpec is
* stored as a list, to cope with the possibility of multiple instances of the
* same label with different data.
*/
function getData(doc, spec) {
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
var data = new Object();
for (key in spec) {
var check = doc.evaluate("//td[contains(text(),''"+spec[key][0]+"'') or contains(text(),''"+spec[key][1]+"'')]/following-sibling::td", doc, nsResolver, XPathResult.ANY_TYPE, null);
{url:item.url.replace("www.journals.uchicago.edu", proxyURL), title:"University of Chicago Journals Snapshot", mimeType:"text/html"},
{url:item.url.replace("www.journals.uchicago.edu", proxyURL).replace("/doi/abs", "/doi/pdf"), title:"University of Chicago Full Text PDF", mimeType:"application/pdf"}
];
if (item.notes[0][''note'']) item.DOI = Zotero.Utilities.trimInternal(item.notes[0][''note''].substr(4));
var sid = newDoc.evaluate(''//input[@name="selectedIds"]'', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext().value;
var nid = newDoc.evaluate(''//input[@name="SID"]'', newDoc, null, XPathResult.ANY_TYPE, null).iterateNext().value;
var post2 = ''product=WOS&product_sid='' + nid + ''&plugin=&product_st_thomas=http://esti.isiknowledge.com:8360/esti/xrpc&export_ref.x=0&export_ref.y=0'';
var post = ''action=go&mode=quickOutput&product=WOS&SID='' + nid + ''&format=ref&fields=BibAbs&mark_id=WOS&count_new_items_marked=0&selectedIds='' + sid + ''&qo_fields=bib&endnote.x=95&endnote.y=12&save_options=default'';
Zotero.Utilities.HTTP.doPost(''http://apps.isiknowledge.com/OutboundService.do'', post, function() {
var hostRegexp = new RegExp("^(https?://[^/]+)/");
var hMatch = hostRegexp.exec(url);
var host = hMatch[1];
var getString1 = "/cgi-bin/philologic31/search3t?dbname=encyclopedie0507&word=&dgdivhead=";
var getString2 = "&dgdivocauthor=&dgdivocplacename=&dgdivocsalutation=&dgdivocclassification=&dgdivocpartofspeech=&dgdivtype=&CONJUNCT=PHRASE&DISTANCE=3&PROXY=or+fewer&OUTPUT=conc&POLESPAN=5&KWSS=1&KWSSPRLIM=500";
REPLACE INTO translators VALUES ('66928fe3-1e93-45a7-8e11-9df6de0a11b3', '1.0.0b3.r1', '', '2007-03-22 16:35:00', '0', '100', '4', 'Max Planck Institute for the History of Science: Virtual Laboratory Library', 'Sean Takats', 'http://vlp.mpiwg-berlin.mpg.de/library/',
'function detectWeb(doc, url){
var namespace = doc.documentElement.namespaceURI;
var nsResolver = namespace ? function(prefix) {
if (prefix == ''x'') return namespace; else return null;
} : null;
var elmt = doc.evaluate(''//base[contains(@href, "/library/data/lit")]'', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
REPLACE INTO csl VALUES ('http://www.zotero.org/styles/chicago-fullnote-bibliography', '2008-11-16 18:00:00', 'Chicago Manual of Style (Full Note with Bibliography)',
REPLACE INTO csl VALUES ('http://www.zotero.org/styles/chicago-note-bibliography', '2008-11-16 18:00:00', 'Chicago Manual of Style (Note with Bibliography)',
REPLACE INTO csl VALUES ('http://www.zotero.org/styles/mhra', '2008-02-02 00:00:00', 'Modern Humanities Research Association (Note with Bibliography)',
REPLACE INTO csl VALUES ('http://www.zotero.org/styles/mhra_note_without_bibliography', '2008-11-16 18:00:00', 'Modern Humanities Research Association (Note without Bibliography)',